<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
        <title>
            <?php  echo $title; ?>
        </title>
        <link rel="stylesheet" type="text/css" href="<?php echo DIR_CSS.'base.css';?>"/>
        <?php 
		foreach ($links as $link) { 
		?>
        <link rel="stylesheet" type="text/css" href="<?php echo DIR_CSS.$link['href']; ?>" />
        <?php } ?>
        <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.8/jquery.min.js">
        </script>
        <?php
		if(isset($scripts)){ 
		foreach ($scripts as $script) { ?>
        <script type="text/javascript" src="<?php echo DIR_JS.$script; ?>">
        </script>
        <?php 
		}}
		 ?>
        <script type="text/javascript">
            function loading(status){
                switch (status) {
                    case 'show':
                        loading('hide');
                        $("BODY").append('<div id="popup_overlay"></div>');
                        $("#popup_overlay").css({
                            position: 'absolute',
                            zIndex: 100000,
                            top: '0px',
                            left: '0px',
                            width: '100%',
                            height: $(document).height(),
                            background: '#FFF',
                            opacity: .01
                        });
                        $("#loadingdiv").show();
                        break;
                    case 'hide':
                        $("#popup_overlay").remove();
                        $("#loadingdiv").hide();
                        break;
                }
            }
        </script>
    </head>
    <body>
        <!-- open container -->
        <div id="container">
            <div id="header">
                <div class="div1">
                    <h1 style="color:#6D6D6D;">Document Management System</h1>
                </div>
                <?php if($logged){ ?>
				<span class="spanlogedin"><?php echo ucfirst($logged); ?></span>
                <div class="menu">
                    <ul class="myMenu">
                        <li id="menu_new">
                            <a href="#">New</a>
                            <ul>
                                <li>
                                    <a href="<?php echo MAIN_PAGE.'docupload';?>">Document</a>
                                </li>
                                <li>
                                    <a href="<?php echo MAIN_PAGE.'fileupload';?>">File</a>
                                </li>
                            </ul>
                        </li>
                        <li id="menu_received">
                            <a href="#">Received</a>
                            <ul>
                                <li>
                                    <a href="<?php echo MAIN_PAGE.'receiveddoc';?>">Document</a>
                                </li>
                                <li>
                                    <a href="<?php echo MAIN_PAGE.'receivedfile';?>">File</a>
                                </li>
                            </ul>
                        </li>
                        <li id="menu_filedoc">
                            <a href="<?php echo MAIN_PAGE.'filedocument';?>">File Docuement</a>
                        </li>						
                        <li id="menu_search">
                            <a href="<?php echo MAIN_PAGE.'search';?>">Search</a>
                        </li>
						<?php if($this->user->getAccessLevel()==1){ ?>
                        <li id="menu_setting">
                            <a href="#">Settings</a>
                            <ul>
                                <li>
                                    <a href="<?php echo MAIN_PAGE.'usermanagement';?>">User</a>
                                </li>
                                <li>
                                    <a href="<?php echo MAIN_PAGE.'department';?>">Department</a>
                                </li>
                                <li>
                                    <a href="<?php echo MAIN_PAGE.'documenttype';?>">Document Type</a>
                                </li>
								<li>
                                    <a href="<?php echo MAIN_PAGE.'authorization';?>">Authorization</a>
                                </li>
                                <li>
                                    <a href="#">Database Restore</a>
                                </li>
                                <li>
                                    <a href="#">Database Backup</a>
                                </li>
                            </ul>
                        </li>
						<?php } ?>
                    </ul>					
                    <script type="text/javascript">
                        $(document).ready(function(){
                            $('.myMenu > li').bind('mouseover', openSubMenu);
                            $('.myMenu > li').bind('mouseout', closeSubMenu);
                            function openSubMenu(){
                                $(this).find('ul').css('visibility', 'visible');
                            };
                            function closeSubMenu(){
                                $(this).find('ul').css('visibility', 'hidden');
                            };
							$(".spanlogedout").click(function(){
                              window.location="<?php echo MAIN_PAGE.'logout';?>";
							});
							 <?php if($selected_menu) {?>
                        	 $('#<?php echo $selected_menu;?> > a').addClass('selectedmenu');
                        	 <?php } ?>
							 <?php if($this->user->getAccessLevel()!=1){ ?>
							 $(".menu").css({
							 	"width":"550px"
							 });
							 <?php } ?>
                            });
                    </script>
                </div>
				<img class="spanlogedout" title="Click here to logout"/>
                <?php } ?>
            </div>
            <!-- open content-->
            <div id="content">
